home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / docs / misc / ConcNews.lha / news / amiga.programming / comp.sys.amiga.programmer_33702_000063.msg < prev    next >
Encoding:
Internet Message Format  |  1994-11-27  |  2.6 KB

  1. Path: news.chalmers.se!sunic!EU.net!uunet!europa.eng.gtefsd.com!newsxfer.itd.umich.edu!nntp.cs.ubc.ca!cs.ubc.ca!cs.ubc.ca!not-for-mail
  2. From: seiler@cs.ubc.ca (Oliver Seiler)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: BorderTop/BorderBottom etc..
  5. Date: 8 Jun 1994 23:54:59 -0700
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Lines: 49
  8. Message-ID: <2t6ec3$26h@cascade.cs.ubc.ca>
  9. References: <1994Jun8.012806.583@hitech.po.my>
  10. NNTP-Posting-Host: cascade.cs.ubc.ca
  11.  
  12. In article <1994Jun8.012806.583@hitech.po.my>,
  13. Terence Tan <terence@hitech.po.my> wrote:
  14. >Quick questions:
  15. >1. What is the best way to findout the inner width/height of a window
  16. >   (Currently I use [Where pWdw is a struct Window  pointer]
  17. >    pWdw->Width - pWdw->BorderLeft - pWdw->BorderRight or
  18.  
  19. This is because these fields measure different things. Generally if
  20. you are subtracting and adding widths and border values you are going
  21. to have to add or subtract a bit (to get it right the first time
  22. try to figure out the offsets using an imaginary "small" window, with
  23. maybe a one pixel wide border, in which case win->BorderLeft is 1,
  24. a drawing area width of 0, etc... Then just scale up...)
  25.  
  26. >    pWdw->Height - pWdw->BorderTop - pWdw->BorderBottom). It doesn't
  27. >    seem to do it properly cause I usually have to adjust it by 1 -2
  28. >    pixels.
  29.  
  30. Use win->BorderTop, win->BorderLeft, etc. if you have the window's open. This
  31. gives you the position of the first location *not* in the border. Before
  32. opening, use the screen fields WBorLeft, WBorTop, etc (WBorTop doesn't
  33. include the title bar, so add scr->Font->ta_YSize+1.) WBorRight and WBorBottom
  34. may not be good to use if you aren't using the standard right and bottom
  35. border settings...
  36.  
  37. To get the width and height of the non-border area of a window use
  38. win->GZZWidth and win->GZZHeight. (Yes this works for non-GZZ windows - 
  39. read the RKMs)
  40.  
  41. >2. Does pWdw->BorderTop take into account the drag bar at the top?
  42. >   Is it font sensitive?
  43.  
  44. Yes to both. I usually just use win->BorderTop+INTERHEIGHT for all my gadgets,
  45. etc..
  46.  
  47. If the window isn't open, use scr->WBorTop+scr->Font->ta_YSize+1 to get the
  48. same value as win->BorderTop...
  49.  
  50. >3. Best way to clear a window?[BltClear??]
  51.  
  52. I'd avoid using the blitter for future compatibility reasons... Umm.
  53. SetRast() followed by RefreshWindowFrame() would probably be fast. Even
  54. better, avoid the RefreshWindowFrame() and use RectFill() on the window's
  55. rastport (being sure to set the proper background color - best way of
  56. getting this is using the DrawInfo pens array...)
  57.  
  58. -Oliver
  59.